<table>
    <?php foreach($data as $message): ?>
	<tr>
            <td><?php echo $message['ChatboxMessage']['nickname']; ?> </td>
            <td><?php echo $message['ChatboxMessage']['content']; ?> </td>
            <?php
            if ($authorized && $authorizedAsAdmin) {
                echo "<td><a href=\"#\" title=\"Usuń\" onclick=\"chatboxDeleteMessage(".$message['ChatboxMessage']['id'].", '".$chatboxId."');\">x</a></td>";
            }
            ?>
	</tr>
    <?php endforeach; ?>
</table>